package day16.feifei;

import java.io.*;

public class Demo03 {
    //构造方法
    public static void m1() throws IOException {
        File file=new File("D:\\file\\book\\cc\\cc.txt");
        OutputStream os=new FileOutputStream(file);
        os.flush();
        os.write('A');
        byte[] bytes=new byte[26];
        for (byte i=65;i<=90;i++){
            bytes[i-65]=i;
        }
        os.write(bytes);
        os.write(bytes);

        os.close();
    }
    public static void m2() throws IOException {
        File file=new File("D:\\file\\book\\cc\\cc.txt");
        //追加
        OutputStream os=new FileOutputStream(file,true);

        os.write('A');
        byte[] bytes=new byte[26];
        for (byte i=65;i<=90;i++){
            bytes[i-65]=i;
        }
        os.write(bytes);
        os.write(bytes);


        os.close();
    }

    public static void main(String[] args) throws Exception {
        m2();
    }
}
